//
//  XYEmotionModel.swift
//  SinaWB_XY
//
//  Created by 小熊猫 on 15/10/23.
//  Copyright © 2015年 小熊猫. All rights reserved.
//

import UIKit

class XYEmotionModel: NSObject ,NSCoding{
   
    //图片简介
    var chs:String?
    //图片的名字
    var png:String?
    //图片的类型.(0是png 1是code)
    var type:Int = 0
    //code Emoji表情
    var code:String?
    //图片表情的路径
    var emojiPath:String?
    
    init(dict:[String:AnyObject]){
        super.init()
        self.setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {   }
    
    
    //保存点击过得表情
    //解档
    required init?(coder aDecoder: NSCoder) {
        chs = aDecoder.decodeObjectForKey("chs") as? String
        png = aDecoder.decodeObjectForKey("png") as? String
        code = aDecoder.decodeObjectForKey("code") as? String
        emojiPath = aDecoder.decodeObjectForKey("emojiPath") as? String
        type = aDecoder.decodeIntegerForKey("type")
    }
    //归档
    func encodeWithCoder(aCoder: NSCoder) {
        aCoder.encodeObject(chs, forKey: "chs")
        aCoder.encodeObject(png, forKey: "png")
        aCoder.encodeObject(code, forKey: "code")
        aCoder.encodeObject(emojiPath, forKey: "emojiPath")
        aCoder.encodeInteger(type, forKey: "type")
    }
}












